package com.stars.services.impl.job;
import com.github.pagehelper.PageInfo;
import com.stars.entity.job.MyScheduleJobEntity;
import com.stars.services.job.MyScheduleJobAccessServices;
import com.stars.dao.mapper.job.MyScheduleJobMapper;
import com.stars.entity.dto.job.MyScheduleJobDTO;

import java.util.List;
import com.stars.entity.ListPage;
import com.github.pagehelper.PageHelper;
import com.stars.services.impl.BaseAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: 任务调度 业务逻辑
 * @author dj
 * @date 2019-10-12 13:54:31
 * @version V1.0
 *
 */
@Service
public class MyScheduleJobAccessServicesImpl  extends BaseAccessServiceImpl<MyScheduleJobMapper , MyScheduleJobEntity> implements  MyScheduleJobAccessServices {
    @Autowired
    private MyScheduleJobMapper  myScheduleJobMapper;


    /**
     * 分页查询
     * @param pageNum 查询参数 起始页，大小。
     * @return
     */
    @Override
    public PageInfo<MyScheduleJobDTO> pageList(Integer pageNum, Integer pageSize, MyScheduleJobDTO dto) throws Exception{
        ListPage<MyScheduleJobDTO> listPage = new ListPage<>(pageNum, pageSize, dto);
        PageHelper.startPage(pageNum, pageSize);
        List<MyScheduleJobDTO> list = myScheduleJobMapper.pageQueryMyScheduleJob(listPage);
        PageInfo<MyScheduleJobDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
